package com.pf.business.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2023/7/16 12:50
 */
@Getter
@AllArgsConstructor
public enum CriteriaTypeEnum {

    ZHI_XUAN(0, "智选"),
    CHE_GUI(1, "车规"),
    OTHER(2, "其他");

    private Integer code;
    private String message;

    public static String getMessageByCode(Integer code) {
        CriteriaTypeEnum[] criteriaTypeEnums = CriteriaTypeEnum.values();
        for (CriteriaTypeEnum e : criteriaTypeEnums) {
            if (e.getCode().equals(code)) {
                return e.getMessage();
            }
        }
        return null;
    }
}
